<style>
.fui-list-inner .vip {
	background: #09ba07 none repeat scroll 0 0;
    color: #fff;
    position: absolute;
    margin-left: 0.2rem;
    height: 0.75rem;
    width: 0.75rem;
    vertical-align: top;
    z-index: 100;
    line-height: 1.1;
    text-align: center;
    border-radius: 0.85rem;
}
.item-up-content {background-color: #fff;border-radius: 10px;padding:0.5rem;margin:0.5rem}
.weui_cells {padding:0;margin-top:0}
.weui_cell_bd {padding:0;padding-bottom:0.3rem;padding-top:0.3rem;color:#999;font-size:0.7rem}
.weui_cell_hd {font-size:0.7rem;padding-bottom:0.3rem;padding-top:0.3rem;margin-right:0.3rem}
.item-ng {}
.item-ng .deleteitem {position: absolute;color:#000;margin-top:-1rem;right:0.5rem}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
	<div class="fui-content">
		<div class="fui-shopsign">
				<div class="store">
					<img class="storeimg" ng-src="{{tomedia(pagedata.item.banner) || '../addons/jy_quan/resource/images/banner.png'}}" style="max-height:400px"/>
					<div class="fui-list-group" style="margin:5px;">
						<div class="fui-list">
							<div class="fui-list-media">
								<img ng-src="{{tomedia(pagedata.member.avatar || '../core/resource/images/nopic.jpg')}}" style=" border-radius: 10px;width:2rem;height:2rem">
							</div>
							<div class="fui-list-inner">
								<div class="title" style="color:#333">{{pagedata.member.nickname || '匿名'}}<span class="vip"><i class="icon jinyunicon icon-vip5" style="font-size:0.5rem;padding-left:0.1rem;color:#fff"></i></span></div>
								<div class="text" style="color:#999;font-size:0.56rem">注册时间:{{pagedata.member.createtime || '12/20 11:18'}} 已发布{{pagedata.itemnum || 0}}个帖子</div>
							</div>
							<div class="fui-list-media">
								<span ng-click="access_json('/myquan/')" class="" style="height:1.3rem;width:1.3rem;border-radius:100%;background:#09ba07">
									<i class="icon icon-yonghujieru" style="padding:0.2rem;color:#fff"></i>
								</span>
								<span ng-click="access_json('/myhome/')" style="height:1.3rem;width:1.3rem;border-radius:100%;background:#f60;margin-left:0.6rem">
									<i class="icon icon-skip" style="padding:0.2rem;color:#fff"></i>
								</span>
							</div>
							
						</div>
					</div>
				</div>
		</div>
		<div class="content-block">
			<!--<div ng-if="pagedata.type == 1" class="item-up-content">
				<div class="tips tips-info">
					<i class="fa fa-bullhorn"></i> 可直接选择现有商城的商品，也可以下面直接添加商品！
				</div>
				<div class="weui_cells weui_cells_form">
					<div class="weui_cell">
									<div class="weui_cell_hd"><label class="weui_label">商品选择</label></div>
									<div class="weui_cell_bd weui_cell_primary" onclick="$('#selectgoods').modal();">
										<ul class="weui_uploader_files" ng-if="pagedata.post.goodsinfo.image">
											  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.post.goodsinfo.image)}})"></li>
										</ul>
										<div ng-if="!pagedata.post.goodsid" class="weui_uploader_input_wrp">
											 <input class="weui_uploader_input" multiple="">
										</div>
									</div>
					</div>
				</div>
			</div>-->
			<div class="item-up-content">
			<div style="border-bottom: 1px solid #ebebeb;color:#999;font-size:0.7rem;padding-bottom:0.3rem">
				<input class="weui_input" type="text" ng-model="pagedata.post.title" placeholder="主题标题">
			</div>
			<div class="item-ng" ng-repeat="item in pagedata.post.content">
				<div class="weui_cells weui_cells_form" style="padding:0;margin-top:0.3rem" ng-if="item.type == 1">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary" style="padding:0;padding-bottom:0.3rem">
							<div class="weui_label" style="margin-bottom:0.3rem"><span>{{item.title}}</span> <i class="icon icon-cuowu r-f bold" style="color:red" ng-click="pagedata.post.content.splice($index,1)"></i> <i ng-if="$index>0" class="icon icon-shangyi r-f" style="margin-right:8rem" ng-click="pagedata.post.content.splice($index-1,0,item);pagedata.post.content.splice($index+1,1)"></i></div>
							<div class="weui_cell_hd">
								
								<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入文字内容" rows="3" style="font-size:0.56rem;color:#999"></textarea>
							</div>
						</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form" style="padding:0;margin-top:0.3rem" ng-if="item.type == 3">
					<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary" style="padding:0;padding-bottom:0.3rem">
								<div class="weui_label" style="margin-bottom:0.3rem"><span>{{item.title}}</span> <i class="icon icon-cuowu r-f bold" style="color:red" ng-click="pagedata.post.content.splice($index,1)"></i> <i ng-if="$index>0" class="icon icon-shangyi r-f" style="margin-right:8rem" ng-click="pagedata.post.content.splice($index-1,0,item);pagedata.post.content.splice($index+1,1)"></i></div>
								<ul class="weui_uploader_files" ng-if="item.data">
									  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
								</ul>
								<div class="weui_uploader_input_wrp">
									 <input class="weui_uploader_input" ng-click="image(item,'data')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
								</div>
							</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form" style="padding:0;margin-top:0.3rem" ng-if="item.type == 10">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary" style="padding:0;padding-bottom:0.3rem">
							<div class="weui_label" style="margin-bottom:0.3rem"><span>{{item.title}}</span> <i class="icon icon-cuowu r-f bold" style="color:red" ng-click="pagedata.post.content.splice($index,1)"></i> <i ng-if="$index>0" class="icon icon-shangyi r-f" style="margin-right:8rem" ng-click="pagedata.post.content.splice($index-1,0,item);pagedata.post.content.splice($index+1,1)"></i></div>
							<div class="weui_uploader">
								<div class="weui_uploader_bd">
									<ul class="weui_uploader_files">
										<li ng-repeat="p in item.data track by $index" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
											<div class="upbtn" >
												<i class="icon icon-shangyi" style="color:#f60;margin-right:1rem" href="javascript:;" ng-click="item.data.splice($index-1,0,p);item.data.splice($index+1,1)"></i>
												<i class="icon icon-close" style="color:#f60" href="javascript:;" ng-click="item.data.splice($index,1)"></i>
											</div>
										</li>
									</ul>
									<div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(item,'data')">
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form" style="padding:0;margin-top:0.3rem" ng-if="item.type == 11">
					<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary" style="">
								<div class="weui_label" style="margin-bottom:0.3rem"><span>{{item.title}}</span> <i class="icon icon-cuowu r-f bold" style="color:red" ng-click="pagedata.post.content.splice($index,1)"></i> <i ng-if="$index>0" class="icon icon-shangyi r-f" style="margin-right:8rem" ng-click="pagedata.post.content.splice($index-1,0,item);pagedata.post.content.splice($index+1,1)"></i></div>
								<ul class="weui_uploader_files" ng-if="item.data">
									  <li class="weui_uploader_file" style="width: 108px;height: 60px;background: #333;">
										<video ng-src="{{tomedia(item.data)}}" ng-poster="{{tomedia(item.thumb)}}" height="60" width="100%"  x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"></video>
									  </li>
								</ul>
								<div class="weui_uploader_input_wrp" ng-if="!item.data">
									 <input class="weui_uploader_input" ng-click="pagedata.up_file($index)"  multiple="">
								</div>
							</div>
					</div>
				</div>
				<div ng-if="pagedata.post.richtext" class="weui_cells weui_cells_form" style="max-height:10rem;overflow-x:hidden;overflow-y:auto;padding:0;margin-top:0.3rem">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary" style="padding:0;padding-bottom:0.3rem">
							<div class="weui_label" style="margin-bottom:0.3rem"><span>富文本内容</span> 
								<i class="icon icon-cuowu r-f bold" style="color:red" ng-click="pagedata.post.richtext=''"></i> 
							</div>
							<div class="weui_cell_hd">
								<p class="weui_textarea" rows="8" style="font-size:0.56rem;color:#999"  ng-bind-html="trust(pagedata.post.richtext)"></p>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="fui-icon-group noborder col-4">
					<div class="fui-icon-col external" ng-click="pagedata.post.content.push({'title':'多图','type':10});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-lunbo" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">多图</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.content.push({'title':'文字','type':1});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-shuru" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">文字</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.content.push({'title':'视频','type':11});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-camera" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">视频</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.content.push({'title':'单图','type':3});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-tuwen" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">图片</div>
					</div>
			</div>
			</div>
			<div ng-if="pagedata.type==5" class="row" style="margin:0 0.5rem;"><div class="jy-2" ng-click="pagedata.selecttext=1"><span ng-class="{'weui_btn':1, 'weui_btn_primary':pagedata.selecttext==1,'weui_btn_plain_primary':pagedata.selecttext!=1}" style="margin:0.5rem">文字选项</span></div><div class="jy-2" ng-click="pagedata.selecttext=0"><span ng-class="{'weui_btn':1, 'weui_btn_primary':pagedata.selecttext!=1,'weui_btn_plain_primary':pagedata.selecttext==1}" style="margin:0.5rem">图片选项</span></div></div>
			<div ng-if="pagedata.type==5 && pagedata.selecttext==1" class="item-up-content item-ng">
				<div ng-repeat="item in pagedata.post.fileds track by $index">
					<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
							</div>
							<div class="weui_cell_ft" style="" ng-click="pagedata.post.fileds.splice($index,1)">
								<i class="icon icon-cuowu bold" style="color:#000">删除</i>
							</div>
						</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form">
						<div class="weui_cell noborder">
							<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.post.fileds.push(pagedata.newfileds);">
								+ 新选项
							</div>
						</div>
				</div>
			</div>
			<div ng-if="pagedata.type==5 && pagedata.selecttext!=1" class="item-up-content item-ng">
				<div ng-repeat="item in pagedata.post.fileds track by $index">
					<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_hd" ng-click="up_file(item,'image','image')"><img ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"  style="width:20px;margin-right:5px;display:block"></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
							</div>
							<div class="weui_cell_ft" style="" ng-click="pagedata.post.fileds.splice($index,1)">
								<i class="icon icon-cuowu bold" style="color:#000">删除</i>
							</div>
						</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form">
						<div class="weui_cell noborder">
							<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.post.fileds.push(pagedata.newfileds);">
								+ 新选项
							</div>
						</div>
				</div>
			</div>
			<div class="weui_cells_title" ng-if="pagedata.type==6" style="margin:0.5rem;padding-left:0.2rem">费用设置</div>
			<div class="item-up-content item-ng" ng-if="pagedata.type==6">
			<div class="weui_cell" >
				<div class="weui_cell_hd"><label class="weui_label">目标费用</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input class="weui_input" type="number" ng-model="pagedata.post.wantmoney" placeholder="输入目标费用">
				</div>
			</div>
			</div>
			<div class="weui_cells_title" ng-if="pagedata.type==2" style="margin:0.5rem;padding-left:0.2rem">红包设置</div>
			<div class="item-up-content item-ng" ng-if="pagedata.type==2">
				<div class="weui_cell" >
					<div class="weui_cell_hd"><label class="weui_label">红包金额</label></div>
					<div ng-if="pagedata.isid!=1" class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.wantmoney" value="{{pagedata.post.wantmoney}}" placeholder="输入红包金额,必须大于1，小于200">
					</div>
					<div ng-if="pagedata.isid==1" class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.wantmoney" value="{{pagedata.post.wantmoney}}" readonly>
					</div>
				</div>
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">红包个数</label></div>
					<div ng-if="pagedata.isid!=1" class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.rednum" value="{{pagedata.post.rednum}}" placeholder="输入总红包个数,必须大于1">
					</div>
					<div ng-if="pagedata.isid==1" class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.rednum" value="{{pagedata.post.rednum}}" readonly>
					</div>
				</div>
			</div>
			<div class="weui_cells_title" ng-if="pagedata.type==7" style="margin:0.5rem;padding-left:0.2rem">电话设置</div>
			<div class="item-up-content item-ng" ng-if="pagedata.type==7">
				<div class="weui_cell" >
					<div class="weui_cell_hd"><label class="weui_label">联系电话</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="number" ng-model="pagedata.post.mobile" placeholder="输入联系电话">
					</div>
				</div>
				<div class="weui_cell" >
					<div class="weui_cell_hd"><label class="weui_label">联系地址</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.post.address" placeholder="输入联系地址">
					</div>
					<div class="weui_cell_ft" ng-click="tool.choose_location(pagedata.post,'address','address');">点击获取</div>
				</div>
			</div>
			<div ng-if="pagedata.type==1" class="weui_cells_title" style="margin:0.5rem;padding-left:0.2rem">商品设置<span onclick="$('#selectgoods').modal();" class="r-f" style="color:red;font-size:0.55rem">商品选择 <i class="icon icon-more" style="font-size:0.6rem;color:#999"></i></span></div>
			<div ng-if="pagedata.type==3" class="weui_cells_title" style="margin:0.5rem;padding-left:0.2rem">报名项目</div>
			<div ng-if="pagedata.isweishop ==1 && pagedata.type==1" class="item-up-content item-ng">
				<div class="weui_cells weui_cells_form" onclick="$('#selectgoods').modal();">
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">商品名称</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="text" ng-model="pagedata.post.goodsinfo.title" readonly>
						</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">商品图片</label></div>
						<div class="weui_cell_bd weui_cell_primary">
									<ul class="weui_uploader_files">
										  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.post.goodsinfo.image)}})"></li>
									</ul>
						</div>
					</div>
				</div>
			</div>
			<div ng-if="(pagedata.isweishop !=1 && pagedata.type==1 && goup[0].title) || pagedata.type==3" class="item-up-content item-ng" ng-repeat="(groupkey,goup) in pagedata.post.fileds track by $index">
					<div ng-if="$index>0 || pagedata.type==1" class="deleteitem" ng-click="pagedata.post.fileds.splice($index,1)"><i class="icon icon-cuowu bold" style="color:#000;font-size:1rem"></i></div>
					<div ng-if="pagedata.type == 3" class="weui_cells_title bold">项目{{$index+1}}</div>
					<div ng-repeat="item in goup">
					<div class="weui_cells weui_cells_form" ng-if="item.type == 1">
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
						</div>
					</div>
					</div>
					<div class="weui_cells weui_cells_form" ng-if="item.type == 2">
					 <div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
						</div>
					</div>
					</div>
					<div class="weui_cells weui_cells_form" ng-if="item.type == 18">
						 <div class="weui_cell">
							<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="item.data" value="{{item.data || '0.00'}}" placeholder="输入{{item.title}}内容">
							</div>
						</div>
					</div>
					<div class="weui_cells weui_cells_form" ng-if="item.type == 3">
						<div class="weui_cell">
								<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
								<div class="weui_cell_bd weui_cell_primary">
									<ul class="weui_uploader_files" ng-if="item.data">
										  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
									</ul>
									<div class="weui_uploader_input_wrp">
										 <input class="weui_uploader_input" ng-model="item.data" ng-click="up_file(item,'data','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
									</div>
								</div>
						</div>
					</div>
						<div ng-if="item.type == 4" class="weui_cells_title">{{item.title}}</div>
						<div ng-if="item.type == 4" class="weui_cells weui_cells_radio2">
								<label class="weui_cell weui_check_label dashed" ng-repeat="(key,value) in item.value">
									<div class="weui_cell_bd weui_cell_primary">
										<span style="float:left;width:100%">{{value.title}}</span>
									</div>
									<div class="weui_cell_ft" href="javascript:;"  ng-click="item.data=value.title;">
										<input type="radio" class="weui_check" name="radio1">
										<span class="weui_icon_checked"></span>
									</div>
								</label>
						</div>	
						<div ng-if="item.type == 5" class="weui_cells_title">{{item.title}}</div>
						<div ng-if="item.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0.5rem">
								<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(key,value) in item.value">
									<input type="checkbox" ng-click="duoxuans(value.title,item,'data')" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" value="{{value.title}}" id="s11"> {{value.title}}
								</div>
						</div>
						<div ng-if="item.type == 6" class="weui_cells_title">{{item.title}}</div>
						<div ng-if="item.type == 6" class="weui_cells weui_cells_form">
						<div class="weui_cell">
								<div class="weui_cell_bd weui_cell_primary">
									<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入{{item.title}}" rows="2"></textarea>
									<div class="weui_textarea_counter"><span>0</span>/118</div>
								</div>
							</div>
						</div>
						<div ng-if="item.type == 7" class="weui_cells_title">{{item.title}}</div>
						<div ng-if="item.type == 7" class="weui_cells weui_cells_form" ng-init="get_data(pagedata.extradata,'province',{plugin:'core',action:'member.set',op:'get'})">
							<div class="weui_cell" ng-init="pagedata.getlocation(item)">
								<div class="fui-cell-label" style="width:33%">
									<select ng-model="item.data.province" class="form-control tpl-province">
									<option value="" selected="selected">省份</option>
									<option ng-repeat="(value,data) in pagedata.extradata.province.province" value="{{value}}" ng-selected="item.data.province==value">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-label" style="width:33%">
									<select ng-model="item.data.city" class="form-control tpl-city">
									<option value="" selected="selected">城市</option>
									<option ng-repeat="(value,data) in pagedata.extradata.province.province[item.data.province]" value="{{value}}" ng-selected="item.data.city==value">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-label" style="width:33%">
									<select ng-model="item.data.district" class="form-control tpl-district">
									<option value="" selected="selected">区县</option>
									<option ng-repeat="(value,data) in pagedata.extradata.province[item.data.province][item.data.city]" value="{{value}}" ng-selected="item.data.district==value">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-label" style="width:28%">
									<select ng-model="item.data.street" class="form-control tpl-district">
									<option value="" selected="selected">街道</option>
									<option ng-repeat="value in pagedata.extradata.province[item.data.province][item.data.city][item.data.district]" value="{{value}}" ng-selected="item.data.street==value">{{value}}</option>
									</select>
								</div>
							</div>
						</div>
						<div class="weui_cells weui_cells_form" ng-if="item.type == 8">
						 <div class="weui_cell" ng-if="item.type == 2">
							<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
							</div>
						</div>
						</div>
						<div class="weui_cells weui_cells_form" ng-if="item.type == 9">
						<div class="weui_cell">
							<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
							</div>
						</div>
						</div>
						<!--规格-->
						<div ng-if="!item.title" class="weui_cells weui_cells_form">
							<div class="weui_cell">
								<div class="weui_cell_bd weui_cell_primary"><label class="weui_label" style="color:#333">规格设置</label></div>
								<div class="weui_cell_ft">
									<div ng-click="pagedata.showoptions=true;pagedata.nowgoodskey=groupkey" class="jylabel jylabel-success">点击设置</div>
								</div>
							</div>
							<div class="weui_cell">
								<span ng-repeat="o in item" class="jylabel jylabel-red" style="margin:0.2rem;line-height:1.2rem">{{o.title}}  ￥{{o.price}}</span>
							</div>
						</div>
					</div>
					<div class="weui_cells weui_cells_form" ng-if="$index+1 >= pagedata.post.fileds.length">
						<div class="weui_cell noborder">
							<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.pushgoods();">
								+ 新项目
							</div>
						</div>
					</div>
			</div>
			<div ng-if="pagedata.type <=3" class="weui_cells_title" style="margin:0.5rem;padding-left:0.2rem">{{pagedata.type>0?'补充其他内容':'互动内容'}}</div>
			<div ng-if="pagedata.type <=3" class="item-up-content item-ng" ng-repeat="item in pagedata.post.diyform">
					<div class="deleteitem" ng-click="pagedata.post.diyform.splice($index,1)"><i class="icon icon-cuowu bold" style="color:#000"></i></div>
					<div class="weui_cells weui_cells_form">
						<div class="weui_cell weui_cell_switch">
							<div class="weui_cell_hd"><label class="weui_label bold">{{$index+1}}.{{item.typename}}:</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="item.title" placeholder="输入{{item.typename}}标题">
							</div>
						</div>
						<div class="weui_cell">
							<div class="weui_cell_hd weui_cell_primary"><label class="weui_label">是否必填?</label></div>
							<div class="weui_cell_ft">
								<input class="weui_switch" type="checkbox" ng-model="item.ismust">
							</div>
						</div>
						<div class="weui_cell" ng-repeat="d in item.value">
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="d.title" placeholder="输入{{d.title}}">
							</div>
							<div class="weui_cell_ft" style="" ng-click="item.value.splice($index,1)">
								<i class="icon icon-cuowu bold" style="color:#000">删除</i>
							</div>
						</div>
						<div class="weui_cell" ng-if="item.type == 4 || item.type == 5">
							<div class="weui_cell_bd weui_cell_primary" ng-click="item.value.push({'title':'选项'+item.value.length});">
								+ 新选项
							</div>
						</div>
					</div>
			</div>
			<div ng-if="pagedata.post.diyform.length<1 && pagedata.type <=3" class="item-up-content" style="padding:1rem;text-align:center;color:#999">
						<p ng-if="pagedata.type==0">至少设置一项接龙内容</p>
						<p>(点击下面图标添加接龙内容)</p>
			</div>
			<div class="item-up-content" ng-if="pagedata.type <=3">
				<div class="fui-icon-group noborder col-6" style="margin-top:0.5rem">
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'填写项','type':1});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-lunbo" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">填写项</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'图片','type':3});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-shuru" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">图片</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'文本','type':6});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-tuwen" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">文本</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'地址','type':7});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-tuwen" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">地址</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'视频','type':11});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-camera" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">视频</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'单选','type':4,'value':[]});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-tuwen" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">单选</div>
					</div>
					<div class="fui-icon-col external" ng-click="pagedata.post.diyform.push({'typename':'多选','type':5,'value':[]});">
						<div class="icon icon-green radius" style="height:0.8rem;line-height:0.8rem;"><i class="icon icon-tuwen" style="font-size:16px;color:#999;height:0.8rem;line-height:0.8rem;"></i></div>
						<div class="text" style="color: #999;padding:0">多选</div>
					</div>
				</div>
			</div>
			<div class="weui_cells_title" style="margin:0.5rem;padding-left:0.2rem">{{pagedata.typetitle || '互动'}}设置</div>
			<div class="fui-cell-group fui-comment-group" style="margin:0.5rem;padding: 0;background-color: #fff;border-radius: 10px;">
				<div class="fui-cell" ng-if="pagedata.type==3 || pagedata.type==0 || pagedata.type==1 || pagedata.type==5">
						<div class="fui-cell-text">让参与人填写信息</div>
						<div class="fui-cell-remark"  onclick="$('#canyuformdiy').modal();" style="color:#61bba7">去设置</div>
				</div>
				<div class="fui-cell" ng-if="pagedata.type==1 && pagedata.pluginset.no_pingtuan!=1">
						<div class="fui-cell-text">拼团方式</div>
						<div class="fui-cell-remark"  onclick="$('#groupbuyset').modal();" style="color:#61bba7">成团{{pagedata.post.groupbuytype==1?'总额':'总数'}}满{{pagedata.post.groupbuyfloor[0].totle}},打{{pagedata.post.groupbuyfloor[0].zhekou}}折</div>
				</div>
				<div class="fui-cell" ng-if="pagedata.type==1">
						<div class="fui-cell-text">物流方式</div>
						<div class="fui-cell-remark" style="color:#61bba7">
						<select ng-model="pagedata.post.groupsendset">
								<option ng-selected="pagedata.post.groupsendset==0" value="0">没有物流</option>
								<option ng-selected="pagedata.post.groupsendset==1" value="1">快递发货</option>
								<option ng-selected="pagedata.post.groupsendset==2" value="2">提货点自提</option>
						</select>
						</div>
				</div>
				<div class="fui-cell">
						<div class="fui-cell-text">传播隐私设置</div>
						<div class="fui-cell-remark" style="color:#61bba7">
						<select ng-model="pagedata.post.share_set" name="share_set">
							<option ng-selected="pagedata.post.share_set==0" value="0">所有人均可转发</option>
							<option ng-selected="pagedata.post.share_set==1" value="1">隐藏接龙且所有人均可转发</option>
							<option ng-selected="pagedata.post.share_set==2" value="2">只有发布者可以转发</option>
						</select>
						</div>
				</div>
				<div class="fui-cell">
						<div class="fui-cell-text">用户隐私设置</div>					
						<div class="fui-cell-remark" style="color:#61bba7">
							<select ng-model="pagedata.post.fansinfo_set" name="fansinfo_set">
								<option ng-selected="pagedata.post.fansinfo_set==0" value="0">公开所有参与者信息</option>
								<option ng-selected="pagedata.post.fansinfo_set==1" value="1">匿名所有参与者信息</option>
							</select>
						</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-text">显示设置</div>
					<div class="fui-cell-remark" style="color:#61bba7">
						<select ng-model="pagedata.post.noquan" name="msg_set">
							<option ng-selected="pagedata.post.noquan==0" value="0">正常显示到圈里</option>
							<option ng-selected="pagedata.post.noquan==1" value="1">不显示到圈里</option>
						</select>
					</div>
				</div>
				<div class="fui-cell">
						<div class="fui-cell-text">活动结束时间</div>
						<div>
							<input class="weui_input fui-cell-remark" style="color:#61bba7" type="date" ng-model="pagedata.post.onlinetime" placeholder="发布后，一周内有效">
						</div>
				</div>
				<div class="fui-cell" ng-if="pagedata.type==3">
						<div class="fui-cell-text">活动地点</div>
						<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.post,'address','address');" style="color:#61bba7">{{pagedata.post.address ||'点击设置'}}</div>
				</div>
				<div class="fui-cell">
						<div class="fui-cell-text">留言设置</div>
						<div class="fui-cell-remark" style="color:#61bba7">
							<select ng-model="pagedata.post.msg_set" name="msg_set">
								<option ng-selected="pagedata.post.msg_set==0" value="0">所有参与者可留言</option>
								<option ng-selected="pagedata.post.msg_set==1" value="1">所有参与者无需留言</option>
							</select>
						</div>
				</div>
				<div class="fui-cell" ng-if="pagedata.type==4">
						<div class="fui-cell-text">文章背景</div>
						<div class="fui-cell-remark"><span style="color:#61bba7">标准</span></div>
				</div>
			</div>
			<div class="weui_cells_checkbox" style="margin-top:1.2rem">
					<div class="fui-cell-label" style="text-align:center;margin:0 auto;padding:0.2rem;font-size:0.56rem">
						<input type="checkbox" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" style="line-height:0.6rem" ng-checked="pagedata.post.checked==true" ng-model="pagedata.post.checked">
						我已阅读并同意 <a onclick="$('#showsystemcontent').modal();" style="color:#61bba7">《会员协议》</a>
					</div>
			</div>
		</div>
	</div>
</div>
<div class="fui-navbar" style="background:#09ba07;">
	<div ng-if="pagedata.type!=2 && (pagedata.isid!=1 || pagedata.post.noshow==1)" style="width:30%;float:left"><a ng-click="pagedata.submit(1);" class="nav-item favorite-item" style="color:#fff;border-right: 1px solid #fff;">保存预览</a></div>
	<div ng-if="pagedata.type!=2 && (pagedata.isid!=1 || pagedata.post.noshow==1)" style="width:70%;float:left"><a href="javascript:;" ng-click="pagedata.submit(0);" class="nav-item" style="color:#fff">发布接龙</a></div>
	<div ng-if="pagedata.type!=2 && pagedata.isid==1 && pagedata.post.noshow!=1" style="width:100%;float:left"><a href="javascript:;" ng-click="pagedata.submit(0);" class="nav-item" style="color:#fff">发布接龙</a></div>
	<div ng-if="pagedata.type==2" ><a href="javascript:;" ng-click="pagedata.payred();" class="nav-item" style="color:#fff">发布接龙</a></div>
</div>
<!-- 规格设置 -->
<div ng-if="pagedata.showoptions" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showoptions=false"></i>
			<div style="height:20rem;padding-bottom:2.5rem;overflow-y:scroll">
			<div class="weui_cells_title subtitle" style="padding:0.1rem 0.5rem">如果拼团商品存在规格，可以点击添加规格.</div>
			<div ng-repeat="o in pagedata.post.fileds[pagedata.nowgoodskey].options" class="item-up-content item-ng">
				<div class="r-f" ng-click="pagedata.post.fileds[pagedata.nowgoodskey].options.splice($index,1)"><i class="icon icon-cuowu bold" style="color:#000"></i></div>
				<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_hd"><label class="weui_label">规格[{{$index+1}}]名称</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="o.title" placeholder="例如：红色，36码">
							</div>
						</div>
						<div class="weui_cell">
							<div class="weui_cell_hd"><label class="weui_label">规格[{{$index+1}}]价格</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="o.price" placeholder="例如：168">
							</div>
						</div>
				</div>
			</div>
			<div class="weui_btn_area">
				<a ng-click="pagedata.post.fileds[pagedata.nowgoodskey].options.push({'title':'','price':''});" class="btn btn-success-o" style="line-height:1.3rem">+ 新规格</a>
			</div>
			<div class="fui-navbar">
				<a ng-click="pagedata.showoptions=false" class="nav-item btn btn-success confirmbtn">确定</a>
			</div>
			</div>
		</div>
	</div>
</div>
<!--参与人填写-->
<div id="canyuformdiy" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom" style="background:#f9f9f9;margin-bottom:2.5rem">
			<!--<div ng-if="pagedata.type==3" class="weui_cells_title subtitle" style="padding:0.1rem 0.5rem;padding-top:0.5rem" style="background:#f9f9f9">以下信息可自定义命名，在接龙中公开显示，也能选择排列顺序</div>
			<div class="weui_cells weui_cells_checkbox" style="padding:0.1rem 0.5rem">
				<label class="weui_cell weui_check_label" ng-repeat="item in pagedata.post.canyufileds" ng-if="$index<2">
					<div class="weui_cell_bd weui_cell_primary" style="width:80%">
						<input class="weui_input" type="text" ng-model="item.title" ng-click="item.title=''" placeholder="{{item.title}}({{item.value}})"/>
					</div>
					<div class="weui_cell_ft" ng-click="toogle(item,'isopen',[1,0])">
						<input type="checkbox" class="weui_check" ng-model="item.isopen" name="isopen" ng-checked="item.isopen ==1">
						<i class="weui_icon_checked"></i>
					</div>
				</label>
			</div>-->
			<div class="weui_cells_title subtitle" style="padding:0.1rem 0.5rem">以下信息在接龙中不公开显示</div>
			<div class="weui_cells weui_cells_checkbox" style="padding:0.1rem 0.5rem">
				<label class="weui_cell weui_check_label" ng-repeat="item in pagedata.post.canyufileds" ng-if="$index<3">
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="item.title" placeholder="{{item.title}}"/>
					</div>
					<div class="weui_cell_ft" ng-click="toogle(item,'isopen',[1,0])">
						<input type="checkbox" class="weui_check" ng-model="item.isopen" name="isopen" ng-checked="item.isopen=='1'">
						<i class="weui_icon_checked"></i>
					</div>
				</label>
				<label class="weui_cell weui_check_label" ng-repeat="item in pagedata.post.canyufileds" ng-if="$index>=3">
					<div class="weui_cell_hd" ng-click="pagedata.post.canyufileds.splice($index,1)"><label class="weui_label"><i class="icon icon-cuowu bold" style="color:#000"></i></label></div>
					<div class="weui_cell_bd weui_cell_primary" style="width:80%">
						<input class="weui_input" type="text" ng-model="item.title" placeholder="{{item.title}}({{$index==0?'可点击命名：如家族姓名、学生名字、楼层等':'可点击命名：如学号、工号、座号等'}})"/>
					</div>
					<div class="weui_cell_ft" ng-click="toogle(item,'isopen',[1,0])">
						<input type="checkbox" class="weui_check" ng-model="item.isopen" name="isopen" ng-checked="item.isopen =='1'">
						<i class="weui_icon_checked"></i>
					</div>
				</label>
				<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.post.canyufileds.push({'title':'表单名称','type':1});">
						+ 新表单
					</div>
				</div>
			</div>
		</div>
		<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-success confirmbtn">确定</a>
		</div>
</div>
</div>
<!--拼团阶梯-->
<div id="groupbuyset" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom" style="background:#f9f9f9;margin-bottom:2.5rem;">
		<div class="weui_cells_title subtitle" style="padding:0.1rem 0.5rem;padding-top:0.5rem" style="background:#f9f9f9">1、用户接龙数：设定所有用户成团的购买总数最低标准；2、总接龙成交金额：设定所有用户成团的购买总金额。（对未成团的所有参与人，由发起人触发退款）</div>	
		<div class="weui_cells_title" style=" padding:0.5rem">成团模式</div>
		<div class="weui_cells weui_cells_radio2" style="margin:0.5rem;padding:0.5rem">
			<label class="weui_cell weui_check_label dashed">
					<div class="weui_cell_bd weui_cell_primary">
						<span style="float:left;width:100%">购买总数拼团</span>
					</div>
					<div class="weui_cell_ft" href="javascript:;"  ng-click="pagedata.post.groupbuytype=0">
							<input type="radio" class="weui_check" name="groupbuytype">
							<span class="weui_icon_checked"></span>
					</div>
			</label>
			<label class="weui_cell weui_check_label dashed">
					<div class="weui_cell_bd weui_cell_primary">
						<span style="float:left;width:100%">交易总额拼团</span>
					</div>
					<div class="weui_cell_ft" href="javascript:;"  ng-click="pagedata.post.groupbuytype=1">
							<input type="radio" class="weui_check" name="groupbuytype">
							<span class="weui_icon_checked"></span>
					</div>
			</label>
		</div>
		<div class="item-up-content item-ng">
				<div ng-repeat="item in pagedata.post.groupbuyfloor track by $index">
					<div class="weui_cells weui_cells_form">
						<div class="weui_cell">
							<div class="weui_cell_hd">成团{{pagedata.post.groupbuytype==1?'总额':'总数'}}（阶梯{{$index+1}}）</div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="text" ng-model="item.totle" placeholder="0.00" style="text-align:right">
							</div>
						</div>
						<div class="weui_cell">
							<div class="weui_cell_hd">拼团折扣(8表示8折)</div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="item.zhekou" placeholder="8" style="text-align:right">
							</div>
						</div>
					</div>
				</div>
				<div class="weui_cells weui_cells_form">
						<div class="weui_cell noborder">
							<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.post.groupbuyfloor.push({'totle':0,'zhekou':8});">
								+ 新阶梯
							</div>
						</div>
				</div>
			</div>
		<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-success confirmbtn">确定</a>
		</div>
</div>
</div>
</div>
<div id="selectgoods" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;bottom:0">
<div class="modal-bottom" style="background:#f9f9f9;">
	<div class="fui-content" style="padding-bottom:2.5rem">
	<div class="fui-fullHigh-group" >
        <div class="fui-fullHigh-item menu" id="tab">
            <nav ng-class="{'on':pagedata.ctype =='all'}" ng-click="pagedata.getlist('all',0)">全部商品</nav>
			<nav ng-class="{'on':pagedata.ctype =='isnew'}" ng-click="pagedata.getlist('isnew',0)">新上宝贝</nav>
			<nav ng-class="{'on':pagedata.ctype =='isrecommand'}" ng-click="pagedata.getlist('isrecommand',0)">推荐宝贝</nav>
			<div ng-repeat="c1 in pagedata.category">
				<nav ng-class="{'on':pagedata.ctype ==c1.id}" ng-click="pagedata.getlist('',c1.id)" ng-show="!c1.enabled && pagedata.shopset.category.level !='-1'">{{c1.title}}</nav>
				<div ng-repeat="c2 in pagedata.category.childs[c1.id]">
					<nav ng-class="{'on':pagedata.ctype ==c2.id}" ng-click="pagedata.getlist('',c2.id)" ng-show="!c2.enabled && pagedata.shopset.category.level>=2">{{c2.title}}</nav>
					<nav ng-repeat="c3 in pagedata.category.childs[c2.id]" ng-class="{'on':pagedata.ctype ==c3.id}" ng-click="pagedata.getlist('',c3.id)" ng-show="!c3.enabled && pagedata.shopset.category.level>=3">{{c3.title}}</nav>
				</div>
			</div>
        </div>
        <div class="fui-fullHigh-item container modal-swiper-y">
				<p ng-if="pagedata.list.length<1" class="text-center text-cancel empty" style="margin-top:2rem;color:#999">暂时没有任何商品</p>
				<div class="fui-list-group goods-list-group" style="margin-top:0;">
					<div ng-repeat="g in pagedata.list" class="fui-list goods-item" aria-hidden="true" data-dismiss="modal" ng-click="pagedata.selectgoods(g);">
							<div class="fui-list-media">
								<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class='round'/>
							</div>
							<div class='fui-list-inner'>
								<div class='subtitle'>{{g.title}}</div>
								<div class='text'><span class='text-danger'>￥{{g.price}}</span></div>
								
							</div>
					</div>
				</div>
				<div ng-if="loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
	   
        </div> 
    </div>
	<div class="fui-navbar">
		<a aria-hidden="true" data-dismiss="modal" ng-click="access_json('jy_weishop/merch//myshop=1&plugin_name=jy_quan')" class="nav-item btn btn-success confirmbtn">进入我的小店</a>
	</div>
	</div>
</div>
</div>
</div>
</div>
<div id="showsystemcontent" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:96%;left:2%;top:1.5%;">
<div class="modal-content" style="min-height:500px">
	<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="right:10px;top:0"><i class="icon jinyunicon icon-wrong" style="color:#ccc;"></i></div>
	<div class="fui-article-page">
			<div class="fui-article-title" style="text-align:center">发帖规则</div>
			<div class="fui-article-content" ng-bind-html="trust(pagedata.gamexieyi.gamecontent)"></div>
	</div>
</div>
</div>
</div>
<script>
scope.pagedata.post.checked =true
scope.pagedata.selecttext=1
if(scope.pagedata._RQ.snsid =='0'){
	window.scope.location(function(re){
		scope.pagedata.post.pcd={};
		scope.pagedata.post.pcd.province = re.addressComponents.province
		scope.pagedata.post.pcd.city = re.addressComponents.city
		scope.pagedata.post.pcd.district = re.addressComponents.district
		scope.$evalAsync();
	});
}
scope.pagedata.pushgoods=function(){
	scope.pagedata.post.fileds.push(angular.copy(scope.pagedata.newfileds))
}
scope.pagedata.submit=function(e,id){
	if(!scope.pagedata.post.checked){
		scope.message('请先阅读并勾选《发帖规则》','error');
		return false;
	}
	if(!scope.pagedata.post.title){
		scope.message('标题不能为空！','error');
		return false;
	}
	if(!scope.pagedata.post.content){
		scope.message('内容不能为空！','error');
		return false;
	}
	if(votestrlen(scope.pagedata.post.title)>120){
		scope.message('标题不能超过60个字！','error');
		return false;
	}
	scope.pagedata.post.noshow = e==1?1:0;
	if(id){
		scope.pagedata.post.payid =id
	}
	var params={
		data:scope.pagedata.post,
		op:'post',
		callback:function(res){
		}
	};
	scope.post_json(params);
}
scope.pagedata.payred=function(){
	if(!scope.pagedata.post.title){
		scope.message('标题不能为空！','error');
		return false;
	}
	if(!scope.pagedata.post.content){
		scope.message('内容不能为空！','error');
		return false;
	}
	if(votestrlen(scope.pagedata.post.title)>40){
		scope.message('标题不能超过20个字！','error');
		return false;
	}
	scope.post_json('payred',scope.pagedata.post,function(pay_id){
		require(['tool'],function(tool){
			tool.pay(pay_id,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.pagedata.submit(0,pay_id);
				}else{
					scope.message('充值失败！');
				}
			});
		});
	});
}
function votestrlen(str){
    var len = 0;
    for (var i=0; i<str.length; i++) { 
     var c = str.charCodeAt(i); 
    //单字节加1 
     if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { 
       len++; 
     } 
     else { 
      len+=2; 
     } 
    } 
    return len;
}
</script>
<script>
scope.loading = true;  //状态标记
scope.isnodata = false;
scope.pagedata.list =[];
scope.pagedata.ctype ='all'
//滚动加载
scope.pagedata.params = {};
scope.pagedata.params.keyword = ''
var page = 1;
scope.pagedata.getlist=function(order,cid){
		if(order){
			page = 1;
			scope.pagedata.list =[];
			scope.pagedata.ctype =order
		}else if(cid){
			page = 1;
			scope.pagedata.list =[];
			scope.pagedata.ctype =cid
		}
		scope.get('jy_weishop/get_data/getgoods/page='+page+'&keyword='+scope.pagedata.params.keyword+'&order='+order+'&cid='+cid+'&frommerch=true',function(data){
			if(data.error !=1 && data!='none'){
								for (var i=0;i<data.length;i++){
									scope.pagedata.list.push(data[i]);
								}
								if(page >1){
									$("#goodslist").animate({scrollTop:0},300);
								}
								if(data.length<1){
									scope.isnodata=true;
								}
								page++;
			}else{
					console.log('error!');
			};
			scope.loading = false;
			scope.$evalAsync();
		});
}
if(scope.pagedata.type==1){
	scope.pagedata.getlist('all',0);
	scope.pagedata.scroll_bottom=function(){
		if(!scope.isnodata && !scope.loading){
			scope.pagedata.getlist();
		}
	}
}
scope.pagedata.selectgoods=function(goodsinfo){
	if(!scope.pagedata.post.fileds[0][0].data){
		scope.pagedata.post.fileds=[];
	}
	scope.pagedata.post.title=scope.pagedata.post.title?scope.pagedata.post.title:'[接龙]-'+goodsinfo.title
	scope.pagedata.post.goodsid=goodsinfo.id
	scope.pagedata.post.goodsinfo=goodsinfo
	scope.pagedata.post.fileds.push([
		{'title':'商品名称','type':'1','data':goodsinfo.title},
		{'title':'商品图片','type':'3','data':goodsinfo.image},
		{'title':'规格','type':'1','data':goodsinfo.unit},
		{'title':'价格(￥)','type':'18','data':goodsinfo.price},
		{'title':'库存','type':'2','data':goodsinfo.totle}
	]);
	if(scope.pagedata.isweishop!=1){
		scope.pagedata.post.richtext=goodsinfo.content;
	}
}
scope.pagedata.goselect=function(value,field){
	var goodsids = scope.pagedata.goodsids;
		if(goodsids==undefined || goodsids==''){
			goodsids=';';
		}
		if(goodsids.indexOf(';'+value+';')<0){
			goodsids=goodsids+value+';';
		}else{
			goodsids=goodsids.replace(';'+value+';',';');
			if(goodsids==';'){
				goodsids='';
			}
		}
	scope.pagedata.goodsids = goodsids
	var params={
		data:{'id':value,'goodsids':goodsids},
		op:'selectgoods',
		callback:function(res){
			scope.message(res)
		}
	};
	scope.post_json(params);
}
scope.pagedata.up_file=function(index){
	scope.choose_source(scope.pagedata.post.content[index],['data','thumb'],'video');
}
</script>